import VueRouter from "vue-router";

/* 导入.vue的组件文件，定义路由 */
import homeContainer from "./components/tabbars/homeContainer.vue";
import vipContainer from "./components/tabbars/vipContainer.vue";
import goodsCartContainer from "./components/tabbars/goodsCartContainer.vue";
import searchContainer from "./components/tabbars/searchContainer.vue";
import newsList from './components/news/newsList.vue';
import newsInfo from './components/news/newsinfo.vue';
import photosList from './components/photoList/photosList.vue';
import photoInfo from "./components/photoList/photoInfo.vue";
import goodsList from "./components/goods/goodsList.vue";
import goodsDetails from "./components/goods/goodsDetails.vue";
import goDesc from "./components/goods/goDesc.vue";
import goComments from "./components/goods/goComments.vue";

var router = new VueRouter({
  routes: [ //路由规则
    {
      path: '/',
      redirect: '/home'
    },
    {
      path: '/home',
      component: homeContainer
    },
    {
      path: '/vip',
      component: vipContainer
    },
    {
      path: '/goodsCart',
      component: goodsCartContainer
    },
    {
      path: '/search',
      component: searchContainer
    },
    {
      path: '/home/newsList',
      component: newsList
    },
    {
      path: '/home/newsinfo/:id',
      component: newsInfo
    },
    {
      path: '/home/photosList',
      component: photosList
    },
    {
      path: "/home/photoInfo/:id",
      component: photoInfo
    },
    {
      path: "/home/goodsList",
      component: goodsList
    },
    {
      path: "/home/goodsDetails/:id",
      component: goodsDetails
    },
    {
      path: "/home/goDesc/:id",
      component: goDesc,
      name: "goDesc"
    },
    {
      path: "/home/goComments/:id",
      component: goComments,
      name: "goComments"
    }
  ],
  linkActiveClass: 'mui-active' //默认的类是router-link-class
});

export default router;